package com.nexgo.payment.databases;

import com.nexgo.payment.constrant.SettlePrintState;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.NotNull;


/**
 * 结算信息表
 */
@Entity(nameInDb = "SETTLE_INFO")
public class SettleInfo {
    @Id(autoincrement = true)
    private Long id;
    /**
     * 商户名称
     */
    @Property(nameInDb = "MER_NAME")
    private String merchantName;
    /**
     * 商户编号
     */
    @Property(nameInDb = "MER_ID")
    private String merchantId;
    /**
     * 终端编号
     */
    @Property(nameInDb = "TER_ID")
    private String terminalId;
    /**
     * 批次号
     */
    @Property(nameInDb = "BATCH_NUM")
    private String batchNum;
    /**
     * 日期
     */
    @Property(nameInDb = "DATE")
    private String date;
    /**
     * 时间
     */
    @Property(nameInDb = "TIME")
    private String time;
    /**
     * 操作员号
     */
    @Property(nameInDb = "OPERATOR")
    private int operator;
    /**
     * 内卡交易统计
     */
    @Property(nameInDb = "STATISTICS_ID")
    private long statisticsId;
    @ToOne(joinProperty = "statisticsId")
    private Statistics statistics;
    /**
     * 外卡交易统计
     */
    @Property(nameInDb = "INTER_STATISTICS_ID")
    private long interStatisticsId;
    @ToOne(joinProperty = "interStatisticsId")
    private Statistics interStatistics;
    /**
     * 内卡交易分类统计
     */
    @Property(nameInDb = "CLASSIFICATION_ID")
    private long classificationId;
    @ToOne(joinProperty = "classificationId")
    private Classification classification;
    /**
     * 外卡交易分类统计
     */
    @Property(nameInDb = "INTER_CLASSIFICATION_ID")
    private long interClassificationId;
    @ToOne(joinProperty = "interClassificationId")
    private Classification interClassification;
    /**
     * 内卡对帐状态
     */
    @Property(nameInDb = "IS_EQU")
    private boolean isEqu;
    /**
     * 外卡对账状态
     */
    @Property(nameInDb = "IS_INTER_EQU")
    private boolean isInterEqu;
    /**
     * 结算打印状态{@link SettlePrintState}
     */
    @Property(nameInDb = "PRINT_STATE")
    private int printState;
    /**
     * 批上送是否已结束
     */
    @Property(nameInDb = "UP_COMPLETE")
    private boolean isBatchUploadComplete;
    /** Used to resolve relations */
    /**
     * 扫码交易统计
     */
    @Property(nameInDb = "SCAN_STATISTICS_ID")
    private long scanStatisticsId;
    @ToOne(joinProperty = "scanStatisticsId")
    private Statistics scanStatistics;

    /**
     * 扫码交易分类统计
     */
    @Property(nameInDb = "SCAN_CLASSIFICATION_ID")
    private long scanClassificationId;
    @ToOne(joinProperty = "scanClassificationId")
    private Classification scanClassification;

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 467006018)
    private transient SettleInfoDao myDao;
    @Generated(hash = 1622334238)
    public SettleInfo(Long id, String merchantName, String merchantId, String terminalId, String batchNum,
            String date, String time, int operator, long statisticsId, long interStatisticsId,
            long classificationId, long interClassificationId, boolean isEqu, boolean isInterEqu, int printState,
            boolean isBatchUploadComplete, long scanStatisticsId, long scanClassificationId) {
        this.id = id;
        this.merchantName = merchantName;
        this.merchantId = merchantId;
        this.terminalId = terminalId;
        this.batchNum = batchNum;
        this.date = date;
        this.time = time;
        this.operator = operator;
        this.statisticsId = statisticsId;
        this.interStatisticsId = interStatisticsId;
        this.classificationId = classificationId;
        this.interClassificationId = interClassificationId;
        this.isEqu = isEqu;
        this.isInterEqu = isInterEqu;
        this.printState = printState;
        this.isBatchUploadComplete = isBatchUploadComplete;
        this.scanStatisticsId = scanStatisticsId;
        this.scanClassificationId = scanClassificationId;
    }
    @Generated(hash = 1492012281)
    public SettleInfo() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMerchantName() {
        return this.merchantName;
    }
    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }
    public String getMerchantId() {
        return this.merchantId;
    }
    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }
    public String getTerminalId() {
        return this.terminalId;
    }
    public void setTerminalId(String terminalId) {
        this.terminalId = terminalId;
    }
    public String getBatchNum() {
        return this.batchNum;
    }
    public void setBatchNum(String batchNum) {
        this.batchNum = batchNum;
    }
    public String getDate() {
        return this.date;
    }
    public void setDate(String date) {
        this.date = date;
    }
    public String getTime() {
        return this.time;
    }
    public void setTime(String time) {
        this.time = time;
    }
    public int getOperator() {
        return this.operator;
    }
    public void setOperator(int operator) {
        this.operator = operator;
    }
    public long getStatisticsId() {
        return this.statisticsId;
    }
    public void setStatisticsId(long statisticsId) {
        this.statisticsId = statisticsId;
    }
    public long getInterStatisticsId() {
        return this.interStatisticsId;
    }
    public void setInterStatisticsId(long interStatisticsId) {
        this.interStatisticsId = interStatisticsId;
    }
    public long getClassificationId() {
        return this.classificationId;
    }
    public void setClassificationId(long classificationId) {
        this.classificationId = classificationId;
    }
    public long getInterClassificationId() {
        return this.interClassificationId;
    }
    public void setInterClassificationId(long interClassificationId) {
        this.interClassificationId = interClassificationId;
    }
    public boolean getIsEqu() {
        return this.isEqu;
    }
    public void setIsEqu(boolean isEqu) {
        this.isEqu = isEqu;
    }
    public boolean getIsInterEqu() {
        return this.isInterEqu;
    }
    public void setIsInterEqu(boolean isInterEqu) {
        this.isInterEqu = isInterEqu;
    }
    public int getPrintState() {
        return this.printState;
    }
    public void setPrintState(int printState) {
        this.printState = printState;
    }
    public boolean getIsBatchUploadComplete() {
        return this.isBatchUploadComplete;
    }
    public void setIsBatchUploadComplete(boolean isBatchUploadComplete) {
        this.isBatchUploadComplete = isBatchUploadComplete;
    }
    @Generated(hash = 1304172889)
    private transient Long statistics__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1816724389)
    public Statistics getStatistics() {
        long __key = this.statisticsId;
        if (statistics__resolvedKey == null || !statistics__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            StatisticsDao targetDao = daoSession.getStatisticsDao();
            Statistics statisticsNew = targetDao.load(__key);
            synchronized (this) {
                statistics = statisticsNew;
                statistics__resolvedKey = __key;
            }
        }
        return statistics;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1409813995)
    public void setStatistics(@NotNull Statistics statistics) {
        if (statistics == null) {
            throw new DaoException(
                    "To-one property 'statisticsId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.statistics = statistics;
            statisticsId = statistics.getId();
            statistics__resolvedKey = statisticsId;
        }
    }
    @Generated(hash = 1315500425)
    private transient Long interStatistics__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1697702530)
    public Statistics getInterStatistics() {
        long __key = this.interStatisticsId;
        if (interStatistics__resolvedKey == null || !interStatistics__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            StatisticsDao targetDao = daoSession.getStatisticsDao();
            Statistics interStatisticsNew = targetDao.load(__key);
            synchronized (this) {
                interStatistics = interStatisticsNew;
                interStatistics__resolvedKey = __key;
            }
        }
        return interStatistics;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1845573518)
    public void setInterStatistics(@NotNull Statistics interStatistics) {
        if (interStatistics == null) {
            throw new DaoException(
                    "To-one property 'interStatisticsId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.interStatistics = interStatistics;
            interStatisticsId = interStatistics.getId();
            interStatistics__resolvedKey = interStatisticsId;
        }
    }
    @Generated(hash = 894795160)
    private transient Long classification__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1387443561)
    public Classification getClassification() {
        long __key = this.classificationId;
        if (classification__resolvedKey == null || !classification__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ClassificationDao targetDao = daoSession.getClassificationDao();
            Classification classificationNew = targetDao.load(__key);
            synchronized (this) {
                classification = classificationNew;
                classification__resolvedKey = __key;
            }
        }
        return classification;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1990029183)
    public void setClassification(@NotNull Classification classification) {
        if (classification == null) {
            throw new DaoException(
                    "To-one property 'classificationId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.classification = classification;
            classificationId = classification.getId();
            classification__resolvedKey = classificationId;
        }
    }
    @Generated(hash = 2078477005)
    private transient Long interClassification__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1859081834)
    public Classification getInterClassification() {
        long __key = this.interClassificationId;
        if (interClassification__resolvedKey == null || !interClassification__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ClassificationDao targetDao = daoSession.getClassificationDao();
            Classification interClassificationNew = targetDao.load(__key);
            synchronized (this) {
                interClassification = interClassificationNew;
                interClassification__resolvedKey = __key;
            }
        }
        return interClassification;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1403599382)
    public void setInterClassification(@NotNull Classification interClassification) {
        if (interClassification == null) {
            throw new DaoException(
                    "To-one property 'interClassificationId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.interClassification = interClassification;
            interClassificationId = interClassification.getId();
            interClassification__resolvedKey = interClassificationId;
        }
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    @Generated(hash = 2099559397)
    private transient Long scanStatistics__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1363700073)
    public Statistics getScanStatistics() {
        long __key = this.scanStatisticsId;
        if (scanStatistics__resolvedKey == null || !scanStatistics__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            StatisticsDao targetDao = daoSession.getStatisticsDao();
            Statistics scanStatisticsNew = targetDao.load(__key);
            synchronized (this) {
                scanStatistics = scanStatisticsNew;
                scanStatistics__resolvedKey = __key;
            }
        }
        return scanStatistics;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 235521862)
    public void setScanStatistics(@NotNull Statistics scanStatistics) {
        if (scanStatistics == null) {
            throw new DaoException(
                    "To-one property 'scanStatisticsId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.scanStatistics = scanStatistics;
            scanStatisticsId = scanStatistics.getId();
            scanStatistics__resolvedKey = scanStatisticsId;
        }
    }
    @Generated(hash = 1965869707)
    private transient Long scanClassification__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1951900811)
    public Classification getScanClassification() {
        long __key = this.scanClassificationId;
        if (scanClassification__resolvedKey == null || !scanClassification__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ClassificationDao targetDao = daoSession.getClassificationDao();
            Classification scanClassificationNew = targetDao.load(__key);
            synchronized (this) {
                scanClassification = scanClassificationNew;
                scanClassification__resolvedKey = __key;
            }
        }
        return scanClassification;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 558263534)
    public void setScanClassification(@NotNull Classification scanClassification) {
        if (scanClassification == null) {
            throw new DaoException(
                    "To-one property 'scanClassificationId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.scanClassification = scanClassification;
            scanClassificationId = scanClassification.getId();
            scanClassification__resolvedKey = scanClassificationId;
        }
    }
    public long getScanStatisticsId() {
        return this.scanStatisticsId;
    }

    public void setScanStatisticsId(long scanStatisticsId) {
        this.scanStatisticsId = scanStatisticsId;
    }

    public long getScanClassificationId() {
        return this.scanClassificationId;
    }

    public void setScanClassificationId(long scanClassificationId) {
        this.scanClassificationId = scanClassificationId;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 412406656)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getSettleInfoDao() : null;
    }
}
